package com.tengol.demo.design.pattern.structural.facade.subsystem;

import com.tengol.demo.design.pattern.structural.facade.domain.PointGift;

import java.text.MessageFormat;

/**
 * 积分支付子系统
 * 模拟积分支付子系统，通过积分购买指定礼物
 *
 * @author dongrui
 * @date 2019/03/05
 */
public class PointPaymentService {
    public boolean pay(PointGift pointGift) {
        if (pointGift != null) {
            String info = "礼物{0}支付成功，花费{1}分，剩余积分300分";
            System.out.println(MessageFormat.format(info,pointGift.getName(),pointGift.getPoint()));
            return true;
        }
        return false;
    }
}
